#include <iostream>
using namespace std;

template <int N>
struct factorial {
    const static int value = factorial<N-1>::value * N;
};

template <>
struct factorial<0> {
    const static int value = 1;
};

int main()
{
    const int n = 10;
    cout << n << "!=" << factorial<n>::value << endl;
    return 0;
}

